home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWCntPrp.cpp < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.0 KB  |  95 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWCntPrp.cpp
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWFrameW.hpp"
  11.  
  12. #ifndef FWCNTPRP_H
  13. #include "FWCntPrp.h"
  14. #endif
  15.  
  16. #ifndef FWFRMING_H
  17. #include "FWFrming.h"
  18. #endif
  19.  
  20. #ifndef FWPRTITE_H
  21. #include "FWPrtIte.h"
  22. #endif
  23.  
  24. //========================================================================================
  25. // RunTime Info
  26. //========================================================================================
  27.  
  28. #ifdef FW_BUILD_MAC
  29. #pragma segment FW_FrameSegment
  30. #endif
  31.  
  32. //========================================================================================
  33. //    class FW_MContainingPropertiesFrame
  34. //========================================================================================
  35.  
  36. FW_DEFINE_AUTO(FW_MContainingPropertiesFrame)
  37. FW_DEFINE_CLASS_M0(FW_MContainingPropertiesFrame)
  38.  
  39. //----------------------------------------------------------------------------------------
  40. //    FW_MContainingPropertiesFrame::FW_MContainingPropertiesFrame
  41. //----------------------------------------------------------------------------------------
  42.  
  43. FW_MContainingPropertiesFrame::FW_MContainingPropertiesFrame()
  44. {
  45.     FW_END_CONSTRUCTOR
  46. }
  47.  
  48. //----------------------------------------------------------------------------------------
  49. //    FW_MContainingPropertiesFrame::~FW_MContainingPropertiesFrame
  50. //----------------------------------------------------------------------------------------
  51.  
  52. FW_MContainingPropertiesFrame::~FW_MContainingPropertiesFrame()
  53. {
  54.     FW_START_DESTRUCTOR
  55. }
  56.  
  57. //----------------------------------------------------------------------------------------
  58. //    FW_MContainingPropertiesFrame::UpdateContainerProperties
  59. //----------------------------------------------------------------------------------------
  60.  
  61. void FW_MContainingPropertiesFrame::UpdateContainerProperties(Environment* ev)
  62. {
  63.     FW_CAcquiredODStorageUnit su = NULL;
  64.     FW_CEmbeddingFrame* frame = FW_DYNAMIC_CAST(FW_CEmbeddingFrame, this);
  65.     
  66.     FW_ASSERT(frame);
  67.     
  68.     FW_CEmbeddingPart* part = FW_DYNAMIC_CAST(FW_CEmbeddingPart, frame->GetPart(ev));
  69.     
  70.     FW_ASSERT(part);
  71.     
  72.     FW_CPartEmbeddedFrameIterator iter(ev, part, frame);
  73.     
  74.     for (ODFrame* frme = iter.First(ev); iter.IsNotComplete(ev); frme = iter.Next(ev))
  75.     {
  76.         if (su == NULL)
  77.             su = AcquirePropertiesStorage(ev, part->GetDraft(ev));
  78.         
  79.         FW_CAcquiredODPart part = frme->AcquirePart(ev);
  80.         part->ContainingPartPropertiesUpdated(ev, frme, su);
  81.     }
  82. }
  83.  
  84. //----------------------------------------------------------------------------------------
  85. //    FW_MContainingPropertiesFrame::AcquirePropertiesStorage
  86. //----------------------------------------------------------------------------------------
  87.  
  88. ODStorageUnit* FW_MContainingPropertiesFrame::AcquirePropertiesStorage(Environment* ev, ODDraft* draft)
  89. {
  90.     ODStorageUnit* su = draft->CreateStorageUnit(ev);
  91.     ExternalizeProperties(ev, su);
  92.     
  93.     return su;
  94. }
  95.